import java.lang.reflect.Type;

public class BankAccount {
    private double balance;
    public BankAccount(double initialBalance)
        {
          this. balance = initialBalance;
        }
        public void deposit(double amount){
        balance += amount;
        System.out.println("Deposited: $" + amount);
        System.out.println("New Balance: $" + balance);
        }
        public void withdraw(double amount){
        balance-= amount;
        System.out.println("Withdrawn: $" + amount);
        System.out.println("New Balance: $" + balance);

        }
        public double getBalance(){
        return balance;
        }
        private void printBlance(){
        System.out.println("Balance(should not be directly accessible)：$" + balance);

        }
        public static void main(String[] args)
        {
            BankAccount account = new BankAccount(1000);
            account.deposit(500);
            account.withdraw(200);
            System.out.println("Final Balance: $" + account.getBalance());
            account.printBlance();
//            the method printBlance() from the type BankAccount is not visible

        }

        }

